home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 031_045 / 033c / Text
Encoding:
Text File  |  1993-08-02  |  6.2 KB  |  171 lines

  1. 21st July 1992
  2. -----------------------------------------------------------------------------
  3. Support Group Application Note 
  4. Number: 033
  5. Issue: 1 
  6. Author: Alastair France
  7. -----------------------------------------------------------------------------
  8.  
  9. Using BAS128 on the Master 128 and Master Compact
  10.  
  11. -----------------------------------------------------------------------------
  12. Applicable Hardware:    Master 128
  13.                         Master Compact
  14.  
  15. Related Application Notes:
  16.  
  17.  
  18. -----------------------------------------------------------------------------
  19. Copyright (C) Acorn Computers Limited 1992
  20.  
  21. Every effort has been made to ensure that the information in this leaflet is 
  22. true and correct at the time of printing. However, the products described in
  23. this leaflet are subject to continuous development and improvements and
  24. Acorn Computers Limited reserves the right to change its specifications at
  25. any time. Acorn Computers Limited cannot accept liability for any loss or
  26. damage arising from the use of any information or particulars in this
  27. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  28. Limited.
  29. -----------------------------------------------------------------------------
  30. Support Group
  31. Acorn Computers Limited
  32. Acorn House
  33. Vision Park
  34. Histon
  35. Cambridge       CB4 4AE
  36. -----------------------------------------------------------------------------
  37.  
  38.  
  39. BAS128 is a version of BBC BASIC which uses Sideways RAM for storage of
  40. programs and data.  Normal versions of BBC BASIC use main memory for storage
  41. of programs and data, meaning that only space between OSHWM and the top of
  42. RAM (&8000) is available for such storage.  With the default value of OSHWM
  43. at &E00 this means that there is only 28.5k free for programs and data. 
  44. Bas128 can use up to 4 banks of sideways RAM - the full amount in the Master
  45. 128 or Master Compact - giving 64k free.
  46.  
  47. The disadvantage of this is that because the RAM is 'paged', access to
  48. programs and data in Bas128 is much slower.  Therefore it is recommended
  49. that the version of BBC BASIC that is installed in the machine is used if
  50. program and data space is not at a premium.
  51.  
  52.  
  53. Bas128 differs from the version of BBC BASIC in the Master (BASIC IV) in the
  54. following respects:
  55.  
  56. *  The assembler will not cope with the extra 65C12 instructions beyond
  57. normal 6502 instructions.
  58.  
  59. *  Use of operands beginning with A will cause problems with instructions
  60. which will accept accumulator addressing.  For example, LSR ANSWER will
  61. assemble as LSR A.
  62.  
  63. *  The A in accumulator addressing must be upper case.  'lsr a' will not
  64. work as 'LSR A'.
  65.  
  66. *  The interpreter will not strip trailing spaces from input line. 
  67. Therefore entering lines such as:
  68.         '10 PRINT"HELLO"        will waste space.
  69.  
  70. *  Leading spaces will not be stripped when non-zero LISTO is set.
  71.  
  72. *  LISTO will not always indent loops correctly.
  73.  
  74. *  LIST IF is not available.
  75.  
  76. *  Renumbering of lines containing the double height character (141) can
  77. caused 'Failed at ...' errors.  This is because the token for line number is
  78. also 141.
  79.  
  80. *  An open files length cannot be changed by using 'EXT#chan=length'.
  81.  
  82. *  TIME$ is not available.
  83.  
  84. *  AUTO puts a space after the line number.
  85.  
  86. *  Problems can occur using functions as formal parameters for FOR/NEXT
  87. loops which themselves  contain loops.  For example:
  88.         DEF FNQ:FORJ%=1TO10:PRINT J%:NEXT:=10
  89.         FOR I=FNQ-9 TO FNQ STEP FNQ/10
  90. will not work as expected in Bas128.
  91.  
  92. *  EDIT cannot be used from Bas128.
  93.  
  94. *  The | character cannot be used to insert trailing zeros in a VDU command.
  95.  
  96. *  ONx ..... will only work with GOTO and GOSUB.  ON x PROCa,PROCb,PROCc
  97. will not work.
  98.  
  99.  
  100. *  The 64k of additional memory is treated as a continuous address space above the normal 64k address 
  101. space of the computer.  The addresses &000000 to &00FFFF refers to the
  102. normal memory, while addresses &010000 to &01FFFF refers to the 64k bytes of
  103. sideways RAM.
  104.     
  105. In Bas128 PAGE defaults to &10000.  HIMEM defaults to &20000.  LOMEM and TOP
  106. are addresses in a similar manner.  It should not be necessary to change the
  107. values of PAGE or HIMEM, except perhaps to allocate space for machine code. 
  108. If they are adjusted remember to set them to sensible values within the
  109. extra address space - it is possible to overwrite the BASIC interpreter by
  110. injudicious use.  Remember to be careful when using ?, $ and ! for similar
  111. reasons.
  112.  
  113. *  Statements such as:
  114.         DIM code% 100
  115. will assign a 17-bit value to code%.  Indirection operators such as !, ? and
  116. $ will address normal memory  if the eventual pointer is between &000000 and
  117. &00FFFF, and will address sideways RAM if the pointer is between &010000 and
  118. &01FFFF.
  119.  
  120. *  In assembler, O% and P% are regarded as 17 bit pointers.  As above, if
  121. the address used is less than  &010000 then normal memory is referenced, if
  122. &010000 or higher then sideways RAM is used.
  123.  
  124. *  As the microprocessor cannot arrange for switching between banks of RAM,
  125. code running in one bank  cannot call code or refer to memory locations in
  126. another bank in normal assembler code.  Such references will therefore give
  127. rise to a Bank error;  eg:
  128.         P%=&13F00:[JSR &1CF34
  129. will give this error.  Beware of referencing sideways RAM memory using
  130. constructions such as:
  131.         LDA #&80
  132.         STA &71
  133.         LDA #0
  134.         STA &70
  135.         TAY
  136.         .loop
  137.         LDA (&70),Y
  138.         ADC #6
  139.         STA (&70),Y
  140.         INY
  141.         BNE loop
  142. This may not produce the expected result.  Altering the value of ROMSEL
  143. (&FE30) may cause unexpected results.
  144.  
  145. Code generated that crosses a bank boundary is also trapped - producing a
  146. Wrap error.  Execution cannot pass directly from one bank to another.
  147.         P%=&13FFC:[LDA #0:TAY:SEC:SBC &70
  148. will give a Wrap error.
  149.  
  150. *  Shadow mode is forced on - Bas128  resides in RAM between &3000 and
  151. &8000.  Remaining memory between OSHWM and &3000 is used by Bas128 for
  152. workspace.
  153.  
  154.  
  155. Transferring Bas128 from tape to disc
  156.  
  157. Connect your data recorder and disc drive and insert the Master Welcome tape
  158. into your data recorder and a formatted disc into your disc drive and type
  159. the following:
  160.  
  161.         *SHADOW
  162.         MODE0
  163.         *TAPE
  164.         *LOAD BAS128 2800
  165.         *DISC
  166.         *SAVE BAS128 2800+24
  167.         *TAPE
  168.         *LOAD BASOBJ 3000
  169.         *DISC
  170.         *SAVE BASOBJ 3000+5000 3100 3000
  171.